home *** CD-ROM | disk | FTP | other *** search
- #ifndef STYLE_H
- #define STYLE_H
-
- /************************************************************************/
- /* Name: Style include file */
- /* */
- /* Purpose: This include file redefines the syntax of a few */
- /* C keywords to be more Ada-like (or Modula-like, etc). */
- /* */
- /* Author: Steve Nies */
- /* */
- /* Date created: 28 April 89 */
- /* */
- /* Disclaimer: This software has been developed privately by the */
- /* Author and has been released into the Public Domain. The */
- /* author makes no claims as to the correctness or suitability */
- /* of the software for the intended purpose. */
- /************************************************************************/
-
- #include "ResourceDefs.h"
-
- #define TBD StopAlert ( NotImplementedID, NULL )
- /* Null word signifying an area To Be Defined that needs more work. */
-
- typedef unsigned int bit16;
- typedef unsigned long bit32;
- #define BIT( bitArray, whichbit ) (bitArray & whichbit)
- #define SETBIT( bitArray, whichbit, value ) (bitArray = bitArray & ~whichbit | value)
- /* Bit array data type. */
-
- typedef char *string;
- /* C string data type. */
-
- typedef void *address;
- /* Address data type representing the address of an object in memory. */
-
- #ifndef NULL
- #define NULL 0L
- #endif
- /* Null pointer. */
-
- #define STR255(string) *((Str255 *) string)
- /* Type conversion from a C string to a Str255 data type pointer. */
-
- void PStrCpy ( register address target, register address source );
- /* Replace a Pascal target string with the contents of a Pascal source string. */
-
- void PStrCat ( register address target, register address source );
- /* Concatenate a Pascal source string to the end of a Pascal target string. */
-
- Boolean PStrCmp ( register address target, register address source );
- /* Return TRUE if two Pascal strings are identical (case sensitive) or FALSE otherwise. */
-
- typedef void (*TVoidFuncObject) ( address value );
- typedef Boolean (*TBoolFuncObject) ( address value );
- /* Apply functions, used for iteration across lists of classes, subclasses, */
- /* attributes, etc. Use TVoidFuncInstance and TBoolFuncInstance, defined in */
- /* OMS.h, for iteration across relationships and instances. */
-
- #define BEGIN {
- #define END }
- #define IF if (
- #define NOT !
- #define AND &&
- #define OR ||
- #define THEN ) {
- #define ELSE } else {
- #define ELSIF } else if (
- #define END_IF }
- #define WHILE while (
- #define LOOP ) {
- #define END_LOOP }
- #define REPEAT while (1) {
- #define END_REPEAT }
- #define FOR for (
- #define SWITCH switch (
- #define WHEN ) {
- #define CASE case
- #define DEFAULT default
- #define END_SWITCH }
- #define BREAK break
- #define EXIT break
- #define RETURN return
- #define IN /* Indicates that data flows into a function. */
- #define OUT /* Indicates that data flows out of a function. */
-
- #endif /* STYLE_H */
-